<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8"/>
    <title>Vue App11</title>
    <script src="http://c3.jsxfang.com/vue/vue.min.js"></script>
    <script src="http://c3.jsxfang.com/vue/vue-resource.min.js"></script>
    <script type="text/javascript">
    </script>
</head>
<body>
<div id="app">
    <span style="font-size: 13px;color: #b2b2b2;" v-show="is_show">Controller Span Is Show   11</span>
    <div v-html="message || HelloFileter"></div>
    <button v-on:hover="counter += 1" v-on:click="counter += 1">{{counter}}</button>
    <input v-model="counter">
    <button v-on:click="test">Check Data</button>
    <input v-model="admin_data.name">
    <input v-model="admin_data.password">
    <button v-on:click="ajax_get">AjaxGet</button>
    <h1>{{ajax_data.msg}}</h1>
</div>
</body>
<script>
    Vue.filter("HelloFileter", function (value) {
        return "<h1>这是过滤器进去的东西！ Hello </h1>"
    })
    var app = new Vue({
        el: '#app',
        data: {
            message: 'Hello Vue!',
            counter: 1,
            is_show: false,
            ajax_data: {},
            admin_data: {}
        },
        methods: {
            test: function (event) {
                if (this.counter > 5) {
                    this.is_show = true;
                    alert("success");
                } else {
                    alert(this.counter);
                }
            },
            ajax_get: function (t) {
                this.$http.get("112http://mall.weizhi.so/shangjia/login/login?" + this.admin_data).then(response => {
                    this.ajax_data = response.body;
                    alert(JSON.stringify(response.body))
                }, response => {

                });
            }
        }
    })

</script>
</html>
